package org.example.service.impl;

import org.example.mapper.AnniversaryMapper;
import org.example.pojo.Anniversary;
import org.example.service.AnniversaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnniversaryServiceImpl implements AnniversaryService {

    @Autowired
    private AnniversaryMapper anniversaryMapper;


    @Override
    public void addAnniversary(String anniversaryName, String anniversaryDate, String url, Integer userId) {
        anniversaryMapper.addAnniversary(anniversaryName, anniversaryDate, url,userId);
    }

    @Override
    public List<Anniversary> list(Integer userId) {
        return anniversaryMapper.list(userId);
    }

    @Override
    public String findByUrl(Integer id) {
        return anniversaryMapper.findByURL(id);
    }

    @Override
    public void editAnniversary(Integer id, String anniversaryName, String anniversaryDate) {
        anniversaryMapper.editAnniversary(id,anniversaryName,anniversaryDate);
    }

    @Override
    public void editPhon(Integer id, String url) {
        anniversaryMapper.editPhon(id,url);
    }

    @Override
    public void deleteAnniversary(Integer id) {
        anniversaryMapper.deleteAnniversary(id);
    }

}
